public class Person {
    public String name;
    public char gender;
    public int age;
    boolean married;
    public boolean Personage( Person another ) {
        if(this.age>22&&another.age>20){return true;}
        return false;
    }
    public boolean Personchar( Person another ){
        if( ( this.gender == '男' && another.gender == '女' ) || ( this.gender == '女' && another.gender == '男' ) ) {
            return true ;
        } 
        return false ;
    }
    public boolean Personmarried( Person another ){
        if(this.married==false&&another.married==false){return true;}
        return false;
        }
       
        public static void main(String[] args) {
        Person p1 = new Person();
        p1.name = "岛市老八";
        p1.gender = '男';
        p1.age=30;
        p1.married = false;
        Person p2 = new Person();
        p2.name = "乔碧萝";
        p2.gender = '女';
        p2.age=28;
        p2.married = false;
        Person p3 = new Person();
        p3.name = "小黑";
        p3.gender = '男';
        p3.age=18;
        p3.married = true;
        boolean one = p1.Personage(p3); //以下三行进行判断
        boolean two = p1.Personchar(p3);
        boolean three =p1.Personmarried(p3);
        
        if(one == two == three){
            System.out.println("可以结婚");
        }else{
            System.out.println("不可以结婚，详情见如下判断");
            System.out.println("年龄是否合适"+one);
            System.out.println("性别是否异性"+two);
            System.out.println("双方是否均未婚"+three);
        }
        
        
    }
    
}